package com.haier.npt.sso.utils;

import org.springframework.http.HttpHeaders;
import org.springframework.security.crypto.codec.Base64;

public class AuthorizationHeaderUtil {
	
	static String app_key = "CkHorSCQuBQwNhgHiKgvPPNWsYYprmXj";
	static String app_secret = "RF9vLUON3pBS4FzeW4DtQ0oK6fUwACGW";
	
	private AuthorizationHeaderUtil(){}
	
	public static HttpHeaders addBasicHeader(){
		HttpHeaders headers = new HttpHeaders();
		headers.add("Authorization", "Basic "+ new String(Base64.encode((app_key + ":" + app_secret).getBytes())));
		return headers;
	}
	
	public static HttpHeaders addBearerHeader(String token ){
		HttpHeaders headers = new HttpHeaders();
		headers.add("Authorization", "Bearer "+token);
		return headers ; 
	}
}
